﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data ;

namespace libAddressBook.BUS
{
    public class clsBUSFindCompany : IDisposable 
    {
        private struct Queries
        {
            public string get_queryCustomerList(string strCompanyID)
            {
                return "SELECT companyHistoryID, comid, oldcomid, portid, comregno, comname, comname2, addbookcode, induscode, website, addline1, addline2, addline3, addline4, areacode, " +
                       "citycode, stacode, poscode, coucode, discode, email, connotepre, insper, insperfra, insminamt, minchaamt, contact, telpre, telno, faxpre, faxno, conope, slclotime, " +
                       "selected, regcust, glno, inscover, remarks, slotbook, bolprefix, holdgrn, holdrea, anote, nbl, fclinscover, fclinsper, fclinsperfra, fclinsminamt, fclstampduty, fclgovtax, " +
                       "memo, fcltermday, customcode, salperson, faxattn, markup, mpercent, byshipmea, allowvariance, cashbill, svbyemail, svbyfax, acccode, accid, billage, billbr, " +
                       "createdby, createddate, lastmodifiedby, lastmodifieddate, vip, minfrtrate, userreportprint, reportprintdate, reportprintby, hakgerakandate, svconsignee, autovesselsc, " +
                       "emailvesselsc, custgradecode, IsExportShprDO, mobilepre, mobileno, comtype, branchID, DateTimeInserted, DateTimeUpdated, HostNameIPAddress, OnUse, " +
                       "OnUseBy, comidHQ,comDefault,comStatus " + 
                       "FROM Customers " +
                       "WHERE ExpiryStatus <> 0 and ltrim(rtrim(comid)) = '" + strCompanyID.Trim() + "' ";
            }

            public string getFindCustomerList
            {
                get
                {
                    return "SELECT mfarea.areacode, mfarea.areaname, mfcity.citycode, mfcity.cityname, mfstate.statecode, " +
                           "mfstate.statename, mfcountry.coucode, mfcountry.coudes,mfcountry.regcode " +
                           "FROM mfstate LEFT OUTER JOIN " +
                           "mfcity LEFT OUTER JOIN " +
                           "mfarea ON mfcity.citycode = mfarea.citycode ON mfstate.statecode = mfcity.statecode RIGHT OUTER JOIN " +
                           "mfcountry ON mfstate.coucode = mfcountry.coucode " +
                           "GROUP BY  mfarea.areaname, mfarea.citycode, mfarea.statecode, mfarea.coucode, mfarea.regcode, mfcountry.regcode, " +
                           "mfcountry.coucode, mfcountry.coudes, mfstate.statecode, mfstate.statename, mfcity.citycode, mfcity.cityname, mfarea.areacode " +
                           "ORDER BY  mfarea.regcode ASC , mfarea.coucode ASC, mfarea.statecode ASC, mfarea.citycode ASC, mfarea.areaname ASC ";
                }
            }
        }

        private string strTempConStr = @"Data Source=193.9.200.92;Initial Catalog=ESB_Security;Integrated Security=True";

        public clsBUSFindCompany()
        {
            
        }

       // protected DataTable get_SearchCriteria


        public void Dispose()
        {
            GC.Collect();
           // throw new NotImplementedException();
        }
    }
}
